<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>The Ajax 01 Page</h1>
<fieldset>
    <legend>Ajax  异步请求</legend>
    <button onclick="doAjaxGet()">Ajax Get Request</button>
    <span id="ajaxResultId">Loading data...</span>
</fieldset>

</body>
<script>
    function doAjaxGet(){
        var xhr=new XMLHttpRequest();
        xhr.onreadystatechange=function (){
            if(xhr.readyState==4&&xhr.status==200){
                console.log(xhr.responseText);
                document.getElementById("ajaxResultId").innerHTML=xhr.responseText;
            }
        };
        xhr.open("GET","http://localhost:1314/doAjaxGet",true);
        xhr.send();
        console.log("do other....");
    }
</script>
</html>